package com.service;

import com.dao.ContactMapper;
import com.pojo.Contact;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class ContactServiceImpl implements ContactService{

    @Autowired
    private ContactMapper contactMapper;

    /**
     * 分页查询所有联系人
     * @param pageIndex
     * @param pageSize
     * @return
     */
    @Override
    public List<Contact> list(int pageIndex, int pageSize,String cname) {
        return contactMapper.list(pageIndex, pageSize,cname);
    }

    @Override
    public int count(String cname) {
        return contactMapper.count(cname);
    }


    @Override
    public int add(Contact contact) {
        return contactMapper.add(contact);
    }

    @Override
    public Contact selectId(int id) {
        return contactMapper.selectId(id);
    }

    @Override
    public int update(Contact contact) {
        return contactMapper.update(contact);
    }
}
